<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Hệ thống tích điểm PVFCCo Central</title>

  <?php
  
    
    
//    <!-- Bootstrap Core CSS -->
    $this->headLink()->appendStylesheet($this->imageUrl() . '/css/bootstrap.css');
    $this->headLink()->appendStylesheet($this->imageUrl() . '/css/datepicker.css');
    $this->headLink()->appendStylesheet($this->imageUrl() . '/css/jqwidgets/styles/jqx.base.css');
    $this->headLink()->appendStylesheet($this->imageUrl() . '/css/jqwidgets/styles/jqx.bootstrap.css');
    $this->headLink()->appendStylesheet($this->imageUrl() . '/js/ckeditor/content.css');
//    <!-- MetisMenu CSS -->
    $this->headLink()->appendStylesheet($this->imageUrl() . '/css/plugins/metisMenu/metisMenu.min.css');
//    <!-- Timeline CSS -->
    $this->headLink()->appendStylesheet($this->imageUrl() . '/css/plugins/dataTables.bootstrap.css');
//    <!-- Custom CSS -->
    $this->headLink()->appendStylesheet($this->imageUrl() . '/css/bootstrap.multiselect.css');
    $this->headLink()->appendStylesheet($this->imageUrl() . '/css/sb-admin-2.css');
   $this->headLink()->appendStylesheet($this->imageUrl().'/css/bootstrap.datepicker.css');
//    <!-- Morris Charts CSS -->
    $this->headLink()->appendStylesheet($this->imageUrl() . '/css/plugins/morris.css');
//    <!-- Custom Fonts -->
    $this->headLink()->appendStylesheet($this->imageUrl() . '/font-awesome-4.1.0/css/font-awesome.min.css');
    $this->headLink()->appendStylesheet($this->imageUrl() . '/js/jquery-ui-1.10.3-themes/start/jquery-ui.css');
    echo $this->headLink();
    ?>
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <?php
    $this->headScript()->appendFile($this->imageUrl() . '/js/jquery-1.11.0.js');
    $this->headScript()->appendFile($this->imageUrl() . '/js/jquery-1.11.1.min.js');
    $this->headScript()->appendFile($this->imageUrl() . '/js/bootstrap.min.js');
    $this->headScript()->appendFile($this->imageUrl() . '/js/bootstrap-datepicker.js');
    $this->headScript()->appendFile($this->imageUrl() . '/js/ckeditor/ckeditor.js');
    $this->headScript()->appendFile($this->imageUrl() . '/js/ckeditor/config.js');
    $this->headScript()->appendFile($this->imageUrl() . '/js/plugins/metisMenu/metisMenu.min.js');
    $this->headScript()->appendFile($this->imageUrl() . '/js/plugins/morris/raphael.min.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/bootstrap.multiselect.js');    
    $this->headScript()->appendFile($this->imageUrl().'/js/bootstrap.datepicker.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/bootbox.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/global.js');
    $this->headScript()->appendFile($this->imageUrl() .'/js/sb-admin-2.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxcore.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxdata.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxbuttons.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxscrollbar.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxlistbox.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxdropdownlist.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxcheckbox.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxmenu.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxgrid.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxgrid.filter.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxgrid.sort.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxgrid.selection.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxgrid.columnsresize.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxgrid.pager.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxgrid.edit.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxpanel.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxgrid.aggregates.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/jqxdatatable.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jqwidgets/globalization/globalize.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/demos.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/jquery-ui-1.10.3.custom.min.js');
    $this->headScript()->appendFile($this->imageUrl().'/js/highcharts/highcharts.js');
    echo $this->headScript();
    ?>
    <script>
        CKEDITOR.replace(".ckeditor");
    </script> 
</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="<?php echo $this->baseUrl()?>/admin/statistic/index">Admin</a>
            </div>
            <!-- /.navbar-header -->
            <?php 
                $identity = Zend_Auth::getInstance()->getIdentity();
                if(!empty($identity)){
            ?>
           
            <ul class="nav navbar-top-links navbar-right">
<!--                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-envelope fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-messages">
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>Read All Messages</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                     /.dropdown-messages 
                </li>
                 /.dropdown 
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-tasks fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-tasks">
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 1</strong>
                                        <span class="pull-right text-muted">40% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
                                            <span class="sr-only">40% Complete (success)</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 2</strong>
                                        <span class="pull-right text-muted">20% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
                                            <span class="sr-only">20% Complete</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 3</strong>
                                        <span class="pull-right text-muted">60% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
                                            <span class="sr-only">60% Complete (warning)</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 4</strong>
                                        <span class="pull-right text-muted">80% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
                                            <span class="sr-only">80% Complete (danger)</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>See All Tasks</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                     /.dropdown-tasks 
                </li>-->
                <!-- /.dropdown -->
<!--                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-bell fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-alerts">
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-comment fa-fw"></i> New Comment
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-twitter fa-fw"></i> 3 New Followers
                                    <span class="pull-right text-muted small">12 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-envelope fa-fw"></i> Message Sent
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-tasks fa-fw"></i> New Task
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-upload fa-fw"></i> Server Rebooted
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>See All Alerts</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                     /.dropdown-alerts -->
                <!--</li>-->
                <!-- /.dropdown -->
                
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="#"><i class="fa fa-user fa-fw"></i><?php echo $identity->user_name ?></a>
                        </li>
                        <li><a href="<?php echo $this->baseUrl() ?>/admin/admin/edit/id/<?php echo $identity->id ?>"><i class="fa fa-gear fa-fw"></i> Chỉnh sửa thông tin</a>
                        </li>
                        <li class="divider"></li>
                        <li><a href="<?php echo $this->baseUrl() ?>/admin/index/logout"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
                        </li>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
             <div class="nav navbar-top-links navbar-right">
                 <a class="navbar-text" href="<?php echo $this->baseUrl() ?>/admin/admin/edit/id/<?php echo $identity->id ?>">Xin chào <?php echo $identity->first_name." ".$identity->last_name ?></a>
            </div>
                <?php } else { ?>
             <ul class="nav navbar-top-links navbar-right">
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="<?php echo $this->baseUrl() ?>/admin/index/login"><i class="fa fa-sign-in fa-fw"></i> Login</a>
                        </li>
                    </ul>
                </li>
            </ul>
                <?php } ?>
            <!-- /.navbar-top-links -->

            <div class="navbar-default sidebar" role="navigation">
                <div class="sidebar-nav navbar-collapse">
                    <ul class="nav" id="side-menu">
<!--                        <li class="sidebar-search">
                            <div class="input-group custom-search-form">
                                <input type="text" class="form-control" placeholder="Search...">
                                <span class="input-group-btn">
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                            </div>
                             /input-group 
                        </li>-->

                        <li>
                            <a class="active" href="#"><i class="fa fa-dashboard fa-fw"></i> Hệ thống<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <?php if($identity->admin_group_id==1){ ?>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/province/list">Tỉnh thành</a>
                                </li>
                                 <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/district/list">Quận huyện</a>
                                </li>
                                 <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/area/index">Khu vực</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl()?>/admin/agentcategory/list">Loại đại lý</a>
                                </li>
                                 <li>
                                    <a href="<?php echo $this->baseUrl()?>/admin/agent/index">Đại lý</a>
                                </li> 
                                <li>
                                    <a href="<?php echo $this->baseUrl()?>/admin/agent/store">Cửa hàng</a>
                                </li> 
                                <?php } else {?>
                                 <li>
                                    <a href="<?php echo $this->baseUrl()?>/admin/agent/list">Đại lý</a>
                                </li> 
                                <li>
                                    <a href="<?php echo $this->baseUrl()?>/admin/agent/liststore">Cửa hàng</a>
                                </li> 
                                <?php }?>
                            </ul>
                        </li>
<?php if($identity->admin_group_id==1){ ?>
                        <li>
                            <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Quản lý sản phẩm<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/productcategory/list">Nhóm sản phẩm</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/product/list">Sản phẩm</a>
                                </li>
<!--                                  <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/agentproduct/list">Đại lý-Sản phẩm</a>
                                </li>-->
                                 <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/areaagentproduct/index">Hệ số điểm sản phẩm</a>
                                </li>                                
                            </ul>
                            
                        </li>
                        <li>
                            <a href="tables.html"><i class="fa fa-table fa-fw"></i>Quản trị đơn hàng<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                 <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/order/index">Danh sách đơn hàng</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/order/order">Nhập tích điểm</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/orderstatus/index">Trạng thái đơn hàng</a>
                                </li>
                            </ul>
                        </li>
<?php }?>
                         <li>
                            <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Thống kê<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/statistic/index1">Thông kê sản phẩm Công ty</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/statistic/index">Thông kê sản phẩm</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/statistic/agent">Thông kê sản phẩm theo Đại lý</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/statistic/area">Thống kê sản phẩm theo khu vực</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/statistic/province">Thông kê sản phẩm theo tỉnh</a>
                                </li>
                                 <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/statistic/district">Thống kê sản phẩm theo Huyện</a>
                                </li>                                
                            </ul>
                        </li>
                        <li>
                            <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Báo cáo<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/report1/index">Danh sách Đại lý cấp 1</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/report2/index">Danh sách Đại lý cấp 2</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/report3/index">Báo cáo bán hàng</a>
                                </li>
                                 <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/report4/index">Báo cáo doanh số theo tháng</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/report5/index">Báo cáo doanh số theo quý</a>
                                </li>
                            </ul>
                        </li>
                        <?php if($identity->admin_group_id==1){ ?>
                        <li>
                            <a href="#"><i class="fa fa-wrench fa-fw"></i> Tài khoản<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/user/list">Đại lý-Cửa hàng</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/admingroup/list">Group Account</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl() ?>/admin/admin/list">Cán bộ nhân viên</a>
                                </li>
                                <li>
                                    <a href="<?php echo $this->baseUrl()?>/admin/adminarea/list">Cán bộ thị trường</a>
                                </li>
<!--                                <li>
                                    <a href="#">Loại đặc quyền</a>
                                </li>
                                <li>
                                    <a href="#">Phân quyền</a>
                                </li>-->
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                         <?php }?>
                         <li>
                            <a href="<?php echo $this->baseUrl() ?>/admin/news/list"><i class="fa fa-bullhorn fa-fw"></i> Tin tức</a>
                            <!-- /.nav-second-level -->
                        </li>
                         <?php if($identity->admin_group_id==1){ ?>
                        <li>
                            <a href="<?php echo $this->baseUrl() ?>/admin/feedback/list"><i class="fa fa-files-o fa-fw"></i> Hỏi đáp</a>
                            <!-- /.nav-second-level -->
                        </li>
                        <?php }?>
                    </ul>
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper">
          <?php echo $this->layout()->content;?>
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery Version 1.11.0 -->   
</body>
</html>
